<?php
/*
+--------------------------------------------------------------------------
|   AffiliStore 2
|   ========================================
|   Web: http://www.affilistore.com
|   Email: admin (at) affilistore (dot) com
|	License Type: AffiliStore 2 is NOT open source software and limitations apply 
|   Licence Info: Visit AffiliStore website and click on 'Licence'
+--------------------------------------------------------------------------
*/
if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
	echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
	exit;
}




$box_content = new XTemplate ("skins/".$configSkin['value']."/styleTemplates/newspage.tpl");

// if news home page
if ($_GET['npag'] == 'home') {
					
        do {
			if ($navOpt[7] == 1) {
			// html perma
			$box_content->assign("LINKDATA",$installDir['value'].'newsitem/'.$newsItemsAll['id'].'/'.urltxt($newsItemsAll['name']).'.html');
			} else {
			// php link
			$box_content->assign("LINKDATA",$installDir['value'].'index.php?case=newsitem&npag='.$newsItemsAll['id']);
			}
			
			$box_content->assign("DATE",'<span style="color:#666666;">'.date('d F Y', $newsItemsAll['timestamp']).'</span>');
			$box_content->assign("DATA",$newsItemsAll['name']);
			$box_content->assign("NEWSCONTENT",$newsItemsAll['content']);
			$box_content->parse("newspage.li");
		
        } while ($newsItemsAll = mysql_fetch_assoc($getNews));
		
		// taken from head
		$box_content->assign("PAGELINKS", $lholder);
		
// if news item page	
} else {
	if ($newsItemsSingle['name'] == NULL) {
	header("HTTP/1.1 301 Moved Permanently");
	header("Location: {$installDir['value']}");
	} else {
			if ($navOpt[7] == 1) {
			// html perma
			$box_content->assign("LINKDATA",$installDir['value'].'newsitem/'.$newsItemsSingle['id'].'/'.urltxt($newsItemsSingle['name']).'.html');
			} else {
			// php link
			$box_content->assign("LINKDATA",$installDir['value'].'index.php?case=newsitem&npag='.$newsItemsSingle['id']);
			}
			
			$box_content->assign("DATE",'<span style="color:#666666">'.date('d F Y', $newsItemsSingle['timestamp']).'</span>');
			$box_content->assign("DATA",$newsItemsSingle['name']);
			$box_content->assign("NEWSCONTENT",$newsItemsSingle['content']);
			$box_content->assign("DIGG",'<p><script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>');
			$box_content->parse("newspage.li");
	}
}

$box_content->assign("SKIN",$configSkin['value']);
$box_content->parse("newspage");
$box_content = $box_content->text("newspage");
?>